$(function(){
    function init_cart(){
        $(".cart").click(function(){
            
            let userid = getCookie("userid");
            let token = getCookie("token");

            if( userid && token ){
                location.href = "./car.html"
            }else{
                location.href = "./login.html#id=1"
                alert("你还没有登录,现在跳转登录页面")
            }
        })
    }
    init_cart()
})